/**
 * @Author: Bobby
 * @Date: 2021-11-08 15:22:19
 * @LastEditTime: 2022-01-08 18:57:36
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\utils\pageTitle.js
 * @CIMC-V2
 */
import store from '@commonProject/store'
// import i18n from '@project/i18n'

/**
 * @description 设置标题
 * @param pageTitle
 * @returns {string}d
 */
export default function getPageTitle(pageTitle) {
  const title = store.getters['user/getAppInfo']['APP_NAME']
  // const { t, te } = i18n.global
  // if (te(`vuiI18n.${pageTitle}`)) pageTitle = t(`vuiI18n.${pageTitle}`)
  let newTitles = []
  if (pageTitle) newTitles.push(pageTitle)
  if (title) newTitles.push(title)

  if (process.env.VUE_APP_BuildProjectType === 'mobile') {
    if (newTitles.length <= 1) {
      console.log('newTitles===', newTitles)
      newTitles = ['WMS手持移动终端系统']
    } else if (newTitles.length > 1) {
      newTitles[1] = 'WMS手持移动终端系统'
    }
  }
  return newTitles.join('-')
}
